"use strict";
var teticket_result = /** @class */ (function () {
    function teticket_result() {
    }
    teticket_result.prototype.initView = function () {
        this.initLineInfo();
        this.initPayWays();
        this.counDownTime();
    };
    teticket_result.prototype.initLineInfo = function () {
        $("#span-min").html("20");
        $("#span-sec").html("08");
        $("#span-paymoany").html("70");
        $("#eticket-payorder-info-month").html("4月27日");
        $("#eticket-payorder-info-week").html("周一");
        $("#eticket-payorder-info-hour").html("14:00");
        $("#eticket-payorder-info-start").html("长春上地园区");
        $("#eticket-payorder-info-end").html("长春机场");
    };
    teticket_result.prototype.initPayWays = function () {
        var payways = [{
                "wayicon": "wxpay",
                "wayname": "微信"
            }];
        var payHtml = "";
        $.each(payways, function (i, o) {
            payHtml += '<li onclick="teticket_result.changeSelect()"><img src="images/{0}.png" class="eticket-payorder-info-ways-icon" /><span class="eticket-payorder-info-ways-des">{1}</span><img src="images/noselect.png" data-check="0" class="eticket-payorder-info-ways-check">'.format(o.wayicon, o.wayname);
        });
        $(".eticket-payorder-info-ways").html(payHtml);
    };
    teticket_result.prototype.counDownTime = function () {
        var paylefttime = 1000;
        countDown((new Date()).getTime(), paylefttime, function (val) {
            var hour = Math.floor(val / 3600);
            ;
            var minute = Math.floor((val - hour * 3600) / 60);
            var second = Math.floor(val - hour * 3600 - minute * 60);
            var shour = hour < 10 ? ("0" + hour) : hour;
            var sminute = minute < 10 ? ("0" + minute) : minute;
            var ssecond = second < 10 ? ("0" + second) : second;
            $("#span-min").text(sminute);
            $("#span-sec").text(ssecond);
        }, function () {
            $("#span-min").text('00');
            $("#span-sec").text('00');
        });
    };
    teticket_result.prototype.changeSelect = function (event) {
        var e = event || window.event;
        var target = e.target;
        if (target.tagName.toLowerCase() == 'li') {
            target = target.lastElementChild;
        }
        var datacheck = $(target).attr("data-check");
        if (datacheck == "0") {
            $(target).attr("src", "images/noselect.png");
            $(target).attr("data-check", "1");
        }
        else {
            $(target).attr("src", "images/select.png");
            $(target).attr("data-check", "0");
        }
    };
    return teticket_result;
}());
$(function () {
    var obj = new teticket_result();
    window.teticket_result = obj;
    obj.initView();
});
